package com.nd.controller.wx;


import com.nd.pojo.bo.wx.CommentPostBO;
import com.nd.pojo.vo.wx.BaseRespWXVo;
import com.nd.pojo.vo.wx.CommentCountVO;
import com.nd.pojo.vo.wx.CommentListVO;
import com.nd.pojo.vo.wx.CommentPostVO;
import com.nd.service.wx.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @author: Aaron
 * @create: 2021-06-08 15:20
 **/
@RestController
@RequestMapping("wx")
public class CommentController {
    @Autowired
    CommentService commentService;

    @RequestMapping("comment/list")
    public BaseRespWXVo commentList(Integer valueId, Byte type, Integer size, Integer page, Integer showType) {
        CommentListVO commentListVO = commentService.commentList(valueId,type,size,page,showType);
        return BaseRespWXVo.ok(commentListVO);
    }

    @RequestMapping("comment/count")
    public BaseRespWXVo commentCount(Integer valueId, Byte type) {
        CommentCountVO commentCountVO = commentService.commentCount(valueId,type);
        return BaseRespWXVo.ok(commentCountVO);
    }

    @RequestMapping("comment/post")
    public BaseRespWXVo commentPost(@RequestBody CommentPostBO commentPostBO) {
        CommentPostVO commentPostVO = commentService.commentPost(commentPostBO);
        return BaseRespWXVo.ok(commentPostVO);
    }

}
